home *** CD-ROM | disk | FTP | other *** search
- VERSION 2.00
- Begin Form Picprint
- Caption = "Picture Print Demo"
- ClientHeight = 4020
- ClientLeft = 1380
- ClientTop = 2040
- ClientWidth = 7365
- Height = 4710
- Left = 1320
- LinkMode = 1 'Source
- LinkTopic = "Form1"
- ScaleHeight = 4020
- ScaleWidth = 7365
- Top = 1410
- Width = 7485
- Begin CommandButton CmdPrintMF
- Caption = "Print Metafile"
- Height = 375
- Left = 4860
- TabIndex = 8
- Top = 2700
- Width = 2355
- End
- Begin CommandButton CmdPreviewMF
- Caption = "Preview Metafile"
- Height = 375
- Left = 4860
- TabIndex = 7
- Top = 2280
- Width = 2355
- End
- Begin CommandButton CmdLoadMF
- Caption = "Load Metafile From Disk"
- Height = 375
- Left = 4860
- TabIndex = 6
- Top = 1860
- Width = 2355
- End
- Begin CommandButton CmdFromBitmap
- Caption = "Load DIB From Bitmap"
- Height = 375
- Left = 4860
- TabIndex = 5
- Top = 180
- Width = 2355
- End
- Begin CommandButton CmdPreviewBitmap
- Caption = "Preview Bitmap"
- Height = 375
- Left = 4860
- TabIndex = 4
- Top = 1020
- Width = 2355
- End
- Begin PictureBox PicPreview
- Height = 3675
- Left = 120
- ScaleHeight = 243
- ScaleMode = 3 'Pixel
- ScaleWidth = 295
- TabIndex = 3
- Top = 180
- Width = 4455
- End
- Begin CommandButton Command1
- Caption = "Load DIB From File"
- Height = 375
- Left = 4860
- TabIndex = 2
- Top = 600
- Width = 2355
- End
- Begin ccCallback Callback1
- IntVersion = 5
- Left = 6660
- Top = 3300
- Type = 1 'AbortProc
- End
- Begin CommandButton CmdPrintBitmap
- Caption = "Print Bitmap"
- Height = 375
- Left = 4860
- TabIndex = 1
- Top = 1440
- Width = 2355
- End
- Begin PictureBox Picture1
- AutoRedraw = -1 'True
- Height = 735
- Left = 4680
- Picture = PICPRINT.FRX:0000
- ScaleHeight = 705
- ScaleWidth = 1725
- TabIndex = 0
- Top = 3240
- Width = 1755
- End
- Begin Menu MenuConfigPrinter
- Caption = "ConfigPrinter"
- Begin Menu MenuExtDevMode
- Caption = "ExtDevMode"
- End
- Begin Menu MenuDevMode
- Caption = "DevMode"
- End
- Begin Menu MenuPaperSizes
- Caption = "PaperSizes"
- End
- End
- Option Explicit
- Dim dib As DIBSTRUCT
- Dim hmf As Integer
- ' This function is called during the EndPage API function
- ' to allow the user to abort printing
- Sub Callback1_AbortProc (hPr As Integer, code As Integer, retval As Integer)
- ' We must allow events to take place, otherwise the
- ' user button press on the abortform form will never
- ' be detected!
- DoEvents
- If code = SP_OUTOFDISK Or AbortPrinting% Then
- retval = 0
- Exit Sub
- End If
- retval = -1
- End Sub
- Sub CmdFromBitmap_Click ()
- Screen.MousePointer = 11
- LoadTheBitmap2 dib
- Screen.MousePointer = 0
- End Sub
- Sub CmdLoadMF_Click ()
- Dim filename$
- Dim di%
- filename$ = InputBox$("Enter metafile filename", "bitmap", app.Path & "\" & "answmach.wmf")
- Screen.MousePointer = 11
- If hmf% <> 0 Then di% = DeleteMetafile(hmf%)
- hmf% = LoadTheMetafile(filename$)
- Screen.MousePointer = 0
- End Sub
- Sub CmdPreviewBitmap_Click ()
- If dib.bmdata = 0 Then
- MsgBox "No valid bitmap"
- Exit Sub
- End If
- picPreview.Cls
- PrintBitmap picPreview.hDC, picPreview.ScaleWidth, picPreview.ScaleHeight
- End Sub
- Sub CmdPreviewMF_Click ()
- If hmf% = 0 Then
- MsgBox "No valid metafile"
- Exit Sub
- End If
- picPreview.Cls
- PrintTheMetafile picPreview.hDC, picPreview.ScaleWidth, picPreview.ScaleHeight
- End Sub
- ' This function prints the global DIB or metafile
- ' It also sets it into landscape mode - just to show
- ' how it is done
- ' mode% = 0 to print the DIB
- ' mode% = 1 to print the metafile
- Sub CmdPrint (mode%)
- Dim dev$, devname$, devoutput$
- Dim dm As DEVMODE, dmout As DEVMODE
- Dim libhnd%
- Dim bufsize%
- Dim dminstring$, dmoutstring$
- Dim dminaddr&, dmoutaddr&
- Dim prhdc%
- Dim dinfo As DOCINFO
- Dim docname$
- Dim oldcursor%
- Dim di%
- dev$ = GetDefPrinter$() ' Get default printer info
- If dev$ = "" Then Exit Sub
- devname$ = GetDeviceName$(dev$)
- devoutput$ = GetDeviceOutput$(dev$)
- ' Load the device driver library - exit if unavailable
- libhnd% = LoadLibrary(GetDeviceDriver$(dev$) + ".drv")
- If libhnd% = 0 Then GoTo cleanup2
- ' Get a copy of the DEVMODE structure for this printer
- ' First find out how big the DEVMODE structure is
- bufsize% = agExtDeviceMode%(hWnd, libhnd%, 0, devname$, devoutput$, agGetAddressForObject(dm), 0, 0)
- ' Allocate a buffer of that size and get a pointer to it
- dminstring$ = String$(bufsize%, 0)
- dminaddr& = agGetAddressForVBString&(dminstring$)
- dmoutstring$ = String$(bufsize%, 0)
- dmoutaddr& = agGetAddressForVBString&(dmoutstring$)
- ' Get the output DEVMODE structure
- di% = agExtDeviceMode(hWnd, libhnd%, dmoutaddr&, devname$, devoutput$, dminaddr&, 0, DM_OUT_BUFFER)
- ' Copy the data buffer into the DEVMODE structure
- agCopyDataBynum dmoutaddr&, agGetAddressForObject&(dm), 68
- ' Set the orientation, and set the dmField flag so that
- ' the function will know that it is valid.
- dm.dmOrientation = DMORIENT_LANDSCAPE
- dm.dmFields = dm.dmFields Or DM_ORIENTATION
- ' We now have a DC to the default printer
- ' This DC is also initialized to landscape mode
- prhdc% = CreateDC%(GetDeviceDriver$(dev$) + ".drv", devname$, devoutput$, agGetAddressForObject&(dm))
- If prhdc% = 0 Then GoTo cleanup2
- ' The DOCINFO structure is the information that the
- ' print manager will show. This also gives you the
- ' opportunity of dumping output to a file.
- docname$ = "Sample Document"
- dinfo.cbSize = 10
- dinfo.lpszDocName = agGetAddressForLPSTR&(docname$)
- dinfo.lpszOutput = 0
- ' The code that follows can be uncommented if you
- ' have the CBK.VBX control from either the Visual
- ' Basic Programmer's Guide to the Windows API - or
- ' SpyWorks-VB
- ' We set up the abort procdure here
- 'AbortPrinting% = 0
- 'di% = SetAbortProc(prhdc%, Callback1.ProcAddress)
- ' And show the abort form which will be system modal
- 'AbortForm.Show
- 'BringWindowToTop AbortForm.hWnd
- 'AbortForm.Refresh
- 'di% = SetSysModalWindow(AbortForm.hWnd)
- ' The usual print sequence here
- di% = StartDoc(prhdc%, dinfo)
- di% = StartPage(prhdc%)
- If mode% = 0 Then
- PrintBitmap prhdc%, 0, 0
- Else
- PrintTheMetafile prhdc%, 0, 0
- End If
- di% = EndPage(prhdc%)
- If di% >= 0 Then di% = EndDocAPI(prhdc%)
- ' You must unload it (not hide it) so that the
- ' system modal state will be released.
- Unload AbortForm
- cleanup2:
- If prhdc% <> 0 Then di% = DeleteDC%(prhdc%)
- If libhnd% <> 0 Then FreeLibrary libhnd%
- End Sub
- Sub CmdPrintBitmap_Click ()
- If dib.bmdata = 0 Then
- MsgBox "No valid bitmap"
- Exit Sub
- End If
- Screen.MousePointer = 11
- CmdPrint 0 ' Print the DIB
- Screen.MousePointer = 1
- End Sub
- Sub CmdPrintMF_Click ()
- If hmf% = 0 Then
- MsgBox "No valid metafile"
- Exit Sub
- End If
- Screen.MousePointer = 11
- CmdPrint 1 ' Print the DIB
- Screen.MousePointer = 1
- End Sub
- Sub Command1_Click ()
- Dim filename$
- filename$ = InputBox$("Enter bitmap filename", "bitmap", app.Path & "\" & "leaves.bmp")
- Screen.MousePointer = 11
- LoadTheBitmap filename$, dib
- Screen.MousePointer = 0
- End Sub
- ' This function retrieves the definition of the default
- ' printer on this system
- Function GetDefPrinter$ ()
- Dim def$
- Dim di%
- def$ = String$(128, 0)
- di% = GetProfileString%("WINDOWS", "DEVICE", "", def$, 127)
- def$ = agGetStringFromLPSTR$(def$)
- GetDefPrinter$ = def$
- End Function
- ' This function returns the driver module name
- Function GetDeviceDriver$ (dev$)
- Dim firstpos%, nextpos%
- firstpos% = InStr(dev$, ",")
- nextpos% = InStr(firstpos% + 1, dev$, ",")
- GetDeviceDriver$ = Mid$(dev$, firstpos% + 1, nextpos% - firstpos% - 1)
- End Function
- ' Retrieves the name portion of a device string
- Function GetDeviceName$ (dev$)
- Dim npos%
- npos% = InStr(dev$, ",")
- GetDeviceName$ = Left$(dev$, npos% - 1)
- End Function
- ' Returns the output destination for the specified device
- Function GetDeviceOutput$ (dev$)
- Dim firstpos%, nextpos%
- firstpos% = InStr(dev$, ",")
- nextpos% = InStr(firstpos% + 1, dev$, ",")
- GetDeviceOutput$ = Mid$(dev$, nextpos% + 1)
- End Function
- ' Loads the DIB from the specified file.
- Sub LoadTheBitmap (filename$, dib As DIBSTRUCT)
- Dim fhnd%
- Dim fileheader As BITMAPFILEHEADER
- Dim di%
- Dim bminfosize%
- Dim bufsize&
- Dim gptr&
- ' Open the file to read
- fhnd% = lopen(filename$, 0)
- If fhnd% < 0 Then Exit Sub
- ' Clear prior DIB value if present
- If dib.bmdata <> 0 Then
- di% = GlobalFree(dib.bmdata)
- dib.bmdata = 0
- End If
- ' First read the file header
- di% = lread(fhnd%, agGetAddressForObject(fileheader), Len(fileheader))
- If (fileheader.bfType <> &H4D42) Then
- di% = lclose(fhnd%)
- Exit Sub
- End If
- ' Now we need a buffer that will contain the header and palette info
- ' How large is it?
- bminfosize = fileheader.bfOffBits - Len(fileheader)
- dib.bminfo = String$(bminfosize, 0)
- di% = lread(fhnd%, agGetAddressForVBString(dib.bminfo), bminfosize)
- ' Calculate the size of the rest of the file
- bufsize& = fileheader.bfSize - bminfosize - Len(fileheader)
- ' Now allocate a buffer to hold the data
- ' We use the global memory pool because this buffer
- ' could easily be above 64k bytes.
- dib.bmdata = GlobalAlloc(GMEM_MOVEABLE, bufsize&)
- gptr& = GlobalLock&(dib.bmdata)
- di% = hread(fhnd%, gptr&, bufsize&)
- di% = GlobalUnlock(dib.bmdata)
- di% = lclose(fhnd%)
- End Sub
- ' This function loads a DIB from the bitmap in picture1
- Sub LoadTheBitmap2 (dib As DIBSTRUCT)
- Dim bi As BITMAPINFO
- Dim dctemp%, dctemp2%
- Dim msg$
- Dim bufsize&
- Dim bm As BITMAP
- Dim ghnd%
- Dim gptr&
- Dim xpix%, ypix%
- Dim doscale%
- Dim uy%, ux%
- Dim di%
- ' Clear prior DIB value if present
- If dib.bmdata <> 0 Then
- di% = GlobalFree(dib.bmdata)
- dib.bmdata = 0
- End If
- ' Create a temporary memory DC and select into it
- ' the background picture of the picture1 control.
- dctemp% = CreateCompatibleDC(picture1.hDC)
- ' Get the size of the picture bitmap
- di% = GetObjectAPI%(picture1.Picture, 14, agGetAddressForObject(bm))
- ' Fill the BITMAPINFO for the desired DIB
- bi.bmiHeader.biSize = 40
- bi.bmiHeader.biWidth = bm.bmWidth
- bi.bmiHeader.biHeight = bm.bmHeight
- bi.bmiHeader.biPlanes = 1
- bi.bmiHeader.biBitCount = 4
- bi.bmiHeader.biCompression = BI_RGB
- ' Now calculate the data buffer size needed
- bufsize& = bi.bmiHeader.biWidth
- ' Figure out the number of bytes based on the
- ' number of pixels in each byte. In this case we
- ' really don't need all this code because this example
- ' always uses a 16 color DIB, but the code is shown
- ' here for your future reference
- Select Case bi.bmiHeader.biBitCount
- Case 1
- bufsize& = (bufsize& + 7) / 8
- Case 4
- bufsize& = (bufsize& + 1) / 2
- Case 24
- bufsize& = bufsize& * 3
- End Select
- ' And make sure it aligns on a long boundary
- bufsize& = ((bufsize& + 3) / 4) * 4
- ' And multiply by the # of scan lines
- bufsize& = bufsize& * bi.bmiHeader.biHeight
- ' Now allocate a buffer to hold the data
- ' We use the global memory pool because this buffer
- ' could easily be above 64k bytes.
- ghnd% = GlobalAlloc(GMEM_MOVEABLE, bufsize&)
- gptr& = GlobalLock&(ghnd%)
- di% = GetDIBitsBynum%(dctemp%, picture1.Picture, 0, bm.bmHeight, gptr&, bi, DIB_RGB_COLORS)
- di% = GlobalUnlock(ghnd%) ' Matching unlock
- ' Now store the info in the DIB structure
- dib.bmdata = ghnd%
- dib.bminfo = String$(Len(bi), 0)
- agCopyDataBynum agGetAddressForObject(bi), agGetAddressForLPSTR(dib.bminfo), Len(bi)
- di% = DeleteDC%(dctemp%)
- End Sub
- Function LoadTheMetafile% (filename$)
- Dim fhnd%
- Dim mfile As METAFILEHEADER
- Dim di%, dl&
- Dim mfinfosize&
- Dim currentfileloc&
- Dim gptr&
- Dim mfglbhnd%
- Dim mfhnd%
- ' Open the file to read
- fhnd% = lopen(filename$, 0)
- If fhnd% < 0 Then Exit Function
- ' First read the placeable header file header
- di% = lread(fhnd%, agGetAddressForObject(mfile), Len(mfile))
- If mfile.key <> &H9AC6CDD7 Then
- ' It's not a placeable metafile - so just seek to the start
- di% = llseek(fhnd%, 0, 0)
- End If
- ' Now we need a buffer that will contain the metafile data
- currentfileloc& = llseek(fhnd%, 0, 1)
- mfinfosize& = llseek(fhnd%, 0, 2) - currentfileloc&
- ' Now allocate a buffer to hold the data
- ' We use the global memory pool because this buffer
- ' could easily be above 64k bytes.
- mfglbhnd% = GlobalAlloc(GMEM_MOVEABLE, mfinfosize&)
- gptr& = GlobalLock&(mfglbhnd%)
- dl& = llseek(fhnd%, currentfileloc&, 0)
- dl& = hread(fhnd%, gptr&, mfinfosize)
- di% = GlobalUnlock(mfhnd%)
- di% = lclose(fhnd%)
- mfhnd% = SetMetaFileBitsBetter(mfglbhnd%)
- ' Don't delete the global handle - it holds the metafile data
- LoadTheMetafile = mfhnd%
- End Function
- Sub MenuDevMode_Click ()
- Dim dev$, devname$, devoutput$
- Dim libhnd%
- Dim di%
- dev$ = GetDefPrinter$() ' Get default printer info
- If dev$ = "" Then Exit Sub
- devname$ = GetDeviceName$(dev$)
- devoutput$ = GetDeviceOutput$(dev$)
- ' Load the device driver library - exit if unavailable
- libhnd% = LoadLibrary(GetDeviceDriver$(dev$) + ".drv")
- If libhnd% = 0 Then Exit Sub
- ' WARNING - this allows change of the default printer
- ' settings!
- di% = agDeviceMode(hWnd, libhnd%, devname$, devoutput$)
- FreeLibrary (libhnd%)
- End Sub
- ' Demonstration of the Extended Device Mode function
- Sub MenuExtDevMode_Click ()
- Dim dev$, devname$, devoutput$
- Dim dm As DEVMODE, dmout As DEVMODE
- Dim libhnd%
- Dim bufsize%
- Dim dminstring$, dmoutstring$
- Dim dminaddr&, dmoutaddr&
- Dim di%
- dev$ = GetDefPrinter$() ' Get default printer info
- If dev$ = "" Then Exit Sub
- devname$ = GetDeviceName$(dev$)
- devoutput$ = GetDeviceOutput$(dev$)
- ' Load the device driver library - exit if unavailable
- libhnd% = LoadLibrary(GetDeviceDriver$(dev$) + ".drv")
- If libhnd% = 0 Then Exit Sub
- bufsize% = agExtDeviceMode%(hWnd, libhnd%, 0, devname$, devoutput$, agGetAddressForObject(dm), 0, 0)
- dminstring$ = String$(bufsize%, 0)
- dmoutstring$ = String$(bufsize%, 0)
- dminaddr& = agGetAddressForVBString&(dminstring$)
- dmoutaddr& = agGetAddressForVBString&(dmoutstring$)
- ' The output DEVMODE structure will reflect any changes
- ' made by the printer setup dialog box.
- ' Note that no changes will be made to the default
- ' printer settings!
- di% = agExtDeviceMode(hWnd, libhnd%, dmoutaddr&, devname$, devoutput$, dminaddr&, 0, DM_IN_BUFFER Or DM_IN_PROMPT Or DM_OUT_BUFFER)
- ' Copy the data buffer into the DEVMODE structure
- agCopyDataBynum dmoutaddr&, agGetAddressForObject&(dmout), 68
- ShowDevMode dmout
- cleanup:
- FreeLibrary (libhnd%)
- End Sub
- ' This function shows how to use the agDeviceCapabilities
- ' function to find out how many paper names the device
- ' supports. This technique can be used for any
- ' device capability
- Sub MenuPaperSizes_Click ()
- Dim dev$, devname$, devoutput$
- Dim libhnd%
- Dim papercount%
- Dim papername$
- Dim a$, crlf$, tname$
- Dim x%
- Dim di%
- crlf$ = Chr$(13) + Chr$(10)
- dev$ = GetDefPrinter$() ' Get default printer info
- If dev$ = "" Then Exit Sub
- devname$ = GetDeviceName$(dev$)
- devoutput$ = GetDeviceOutput$(dev$)
- ' Load the device driver library - exit if unavailable
- libhnd% = LoadLibrary(GetDeviceDriver$(dev$) + ".drv")
- If libhnd% = 0 Then Exit Sub
- ' Find out how many paper names there are
- papercount% = agDeviceCapabilities(libhnd%, devname$, devoutput$, DC_PAPERNAMES, 0, 0)
- If papercount% = 0 Then
- MsgBox "No paper names available", 0, "Paper name capability"
- Exit Sub
- End If
- ' Now dimension the string large enough to hold them all
- papername$ = String$(64 * papercount%, 0)
- di% = agDeviceCapabilities(libhnd%, devname$, devoutput$, DC_PAPERNAMES, agGetAddressForVBString&(papername$), 0)
- ' Now display the results
- For x% = 1 To papercount%
- tname$ = Mid$(papername$, (x% - 1) * 64 + 1)
- a$ = a$ + agGetStringFromLPSTR$(tname$) + crlf$
- Next x%
- MsgBox a$, 0, "Paper Names for Default Printer"
- FreeLibrary (libhnd%)
- End Sub
- ' Print the DIB to fit the size specified (in pixels)
- ' If x%,y% are both 0, uses the device extents
- Sub PrintBitmap (ByVal hDC%, ByVal x%, ByVal y%)
- Dim bih As BITMAPINFOHEADER
- Dim xfer$
- Dim bufsize&
- Dim ghnd%
- Dim gptr&
- Dim xpix%, ypix%
- Dim doscale%
- Dim uy%, ux%
- Dim di%
- Dim scalefactorX As Single, scalefactorY As Single
- Dim scalefactor
- If dib.bmdata = 0 Then
- MsgBox "No valid bitmap"
- Exit Sub
- End If
- ' Copy the information into a structure so we can access it
- agCopyDataBynum agGetAddressForVBString(dib.bminfo), agGetAddressForObject(bih), Len(bih)
- gptr& = GlobalLock(dib.bmdata)
- If x% = 0 And y% = 0 Then
- ' We want to scale it to fill the page
- xpix% = GetDeviceCaps(hDC%, HORZRES)
- ' We subtract off the size of the bitmap already
- ' printed, plus some extra space
- ypix% = GetDeviceCaps(hDC%, VERTRES)
- Else
- xpix% = x%
- ypix% = y%
- End If
- ' We need to figure out how to scale it for the page
- scalefactorX = CSng(xpix%) / CSng(bih.biWidth)
- scalefactorY = CSng(ypix%) / CSng(bih.biHeight)
- ' Use the smaller scalefactor
- If scalefactorX < scalefactorY Then scalefactor = scalefactorX Else scalefactor = scalefactorY
- ' Find out the largest multiplier we can use and still
- ' fit on the page
- ux% = CInt(bih.biWidth * scalefactor)
- uy% = CInt(bih.biHeight * scalefactor)
- di% = StretchDIBitsBynum(hDC%, 0, 0, ux%, uy%, 0, 0, bih.biWidth, bih.biHeight, gptr&, agGetAddressForVBString(dib.bminfo), DIB_RGB_COLORS, SRCCOPY)
- ' Dump the global memory block
- di% = GlobalUnlock(ghnd%)
- End Sub
- Sub PrintTheMetafile (ByVal hDC%, ByVal x%, ByVal y%)
- Dim xpix%, ypix%
- Dim uy%, ux%
- Dim di%
- Dim dl&
- Dim savedidx%
- If hmf% = 0 Then
- MsgBox "No valid metafile"
- Exit Sub
- End If
- If x% = 0 And y% = 0 Then
- ' We want to scale it to fill the page
- xpix% = GetDeviceCaps(hDC%, HORZRES)
- ' We subtract off the size of the bitmap already
- ' printed, plus some extra space
- ypix% = GetDeviceCaps(hDC%, VERTRES)
- Else
- xpix% = x%
- ypix% = y%
- End If
- savedidx% = SaveDC(hDC%)
- ' We need to set the extents
- ' ANISOTROPIC mode fills the entire area
- di% = SetMapMode(hDC%, MM_ANISOTROPIC)
- dl& = SetWindowExt(hDC%, xpix%, ypix%)
- dl& = SetViewportExt(hDC%, xpix%, ypix%)
- di% = PlayMetaFile(hDC%, hmf%)
- di% = RestoreDC(hDC%, savedidx%)
- End Sub
- ' Shows information about the current device mode
- Sub ShowDevMode (dm As DEVMODE)
- Dim crlf$
- Dim a$
- crlf$ = Chr$(13) + Chr$(10)
- a$ = "Device name = " + agGetStringFromLPSTR$(dm.dmDeviceName) + crlf$
- a$ = a$ + "Devmode Version: " + Hex$(dm.dmSpecVersion) + ", Driver version: " + Hex$(dm.dmDriverVersion) + crlf$
- a$ = a$ + "Orientation: "
- If dm.dmOrientation = DMORIENT_PORTRAIT Then a$ = a$ + "Portrait" Else a$ = a$ + "Landscape"
- a$ = a$ + crlf$
- a$ = a$ + "Field mask = " + Hex$(dm.dmFields) + crlf$
- a$ = a$ + "Copies = " + Str$(dm.dmCopies) + crlf$
- If dm.dmFields And DM_YRESOLUTION <> 0 Then
- a$ = a$ + "X,Y resolution = " + Str$(dm.dmPrintQuality) + "," + Str$(dm.dmYResolution) + crlf$
- End If
- MsgBox a$, 0, "Devmode structure"
- End Sub
-